package com.xishu.entity.shop;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;


@Table(indexes = {@Index(columnList = "shopId"), @Index(columnList = "createTime")})
@Entity(name = "reason")
public class Reason extends AbstractEntity {
    private static final long serialVersionUID = -4744706834007767865L;

    @ApiModelProperty(value = "归属的分店")
    private Long shopId;

    @ApiModelProperty(value = "分店名称")
    private String shopName;

    @ApiModelProperty(value = "退款分类：1部分付款，2全部付款，3退款，4已下单到厨房的菜从订单中删除,5删除订单,6修改已下发到厨房里面的菜")
    private Long type;

    @ApiModelProperty(value = "取消理由：1客人退菜，2库存不足，3服务员错误操作，4其它,用于做报表处理, 100汇总")
    private Long cancelType;

    @ApiModelProperty(value = "取消理由：1客人退菜，2库存不足，3服务员错误操作，4其它")
    @Transient
    @FieldMapping(desField = "cancelJson", serialize = true)
    private List<Long> cancelTypeList;

    @ApiModelProperty(value = "取消理由：1客人退菜，2库存不足，3服务员错误操作，4其它")
    @FieldMapping(desField = "cancelTypeList", serialize = false, genericType = "java.lang.Long")
    private String cancelJson;

    @ApiModelProperty(value = "订单ID")
    private Long orderId;

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Long getType() {
        return type;
    }

    public void setType(Long type) {
        this.type = type;
    }

    public List<Long> getCancelTypeList() {
        return cancelTypeList;
    }

    public void setCancelTypeList(List<Long> cancelTypeList) {
        this.cancelTypeList = cancelTypeList;
    }

    public String getCancelJson() {
        return cancelJson;
    }

    public void setCancelJson(String cancelJson) {
        this.cancelJson = cancelJson;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getCancelType() {
        return cancelType;
    }

    public void setCancelType(Long cancelType) {
        this.cancelType = cancelType;
    }
}
